home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / me39src1.arc / EVAR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1987-07-08  |  5.3 KB  |  183 lines

  1. /*    EVAR.H:    Environment and user variable definitions
  2.         for MicroEMACS
  3.  
  4.         written 1986 by Daniel Lawrence
  5. */
  6.  
  7. /*    structure to hold user variables and their definitions    */
  8.  
  9. typedef struct UVAR {
  10.     char u_name[NVSIZE + 1];        /* name of user variable */
  11.     char *u_value;                /* value (string) */
  12. } UVAR;
  13.  
  14. /*    current user variables (This structure will probably change)    */
  15.  
  16. #define    MAXVARS        255
  17.  
  18. UVAR uv[MAXVARS];    /* user variables */
  19.  
  20. /*    list of recognized environment variables    */
  21.  
  22. char *envars[] = {
  23.     "fillcol",        /* current fill column */
  24.     "pagelen",        /* number of lines used by editor */
  25.     "curcol",        /* current column pos of cursor */
  26.     "curline",        /* current line in file */
  27.     "ram",            /* ram in use by malloc */
  28.     "flicker",        /* flicker supression */
  29.     "curwidth",        /* current screen width */
  30.     "cbufname",        /* current buffer name */
  31.     "cfname",        /* current file name */
  32.     "sres",            /* current screen resolution */
  33.     "debug",        /* macro debugging */
  34.     "status",        /* returns the status of the last command */
  35.     "palette",        /* current palette string */
  36.     "asave",        /* # of chars between auto-saves */
  37.     "acount",        /* # of chars until next auto-save */
  38.     "lastkey",        /* last keyboard char struck */
  39.     "curchar",        /* current character under the cursor */
  40.     "discmd",        /* display commands on command line */
  41.     "version",        /* current version number */
  42.     "progname",        /* returns current prog name - "MicroEMACS" */
  43.     "seed",            /* current random number seed */
  44.     "disinp",        /* display command line input characters */
  45.     "wline",        /* # of lines in current window */
  46.     "cwline",        /* current screen line in window */
  47.     "target",        /* target for line moves */
  48.     "search",        /* search pattern */
  49.     "replace",        /* replacement pattern */
  50.     "match",        /* last matched magic pattern */
  51.     "kill",            /* kill buffer (read only) */
  52.     "cmode",        /* mode of current buffer */
  53.     "gmode",        /* global modes */
  54.     "tpause",        /* length to pause for paren matching */
  55.     "pending",        /* type ahead pending flag */
  56.     "lwidth",        /* width of current line */
  57.     "line",            /* text of current line */
  58. };
  59.  
  60. #define    NEVARS    sizeof(envars) / sizeof(char *)
  61.  
  62. /*     and its preprocesor definitions        */
  63.  
  64. #define    EVFILLCOL    0
  65. #define    EVPAGELEN    1
  66. #define    EVCURCOL    2
  67. #define    EVCURLINE    3
  68. #define    EVRAM        4
  69. #define    EVFLICKER    5
  70. #define    EVCURWIDTH    6
  71. #define    EVCBUFNAME    7
  72. #define    EVCFNAME    8
  73. #define    EVSRES        9
  74. #define    EVDEBUG        10
  75. #define    EVSTATUS    11
  76. #define    EVPALETTE    12
  77. #define    EVASAVE        13
  78. #define    EVACOUNT    14
  79. #define    EVLASTKEY    15
  80. #define    EVCURCHAR    16
  81. #define    EVDISCMD    17
  82. #define    EVVERSION    18
  83. #define    EVPROGNAME    19
  84. #define    EVSEED        20
  85. #define    EVDISINP    21
  86. #define    EVWLINE        22
  87. #define EVCWLINE    23
  88. #define    EVTARGET    24
  89. #define    EVSEARCH    25
  90. #define    EVREPLACE    26
  91. #define    EVMATCH        27
  92. #define    EVKILL        28
  93. #define    EVCMODE        29
  94. #define    EVGMODE        30
  95. #define    EVTPAUSE    31
  96. #define    EVPENDING    32
  97. #define    EVLWIDTH    33
  98. #define    EVLINE        34
  99.  
  100. /*    list of recognized user functions    */
  101.  
  102. typedef struct UFUNC {
  103.     char *f_name;    /* name of function */
  104.     int f_type;    /* 1 = monamic, 2 = dynamic */
  105. } UFUNC;
  106.  
  107. #define    NILNAMIC    0
  108. #define    MONAMIC        1
  109. #define    DYNAMIC        2
  110. #define    TRINAMIC    3
  111.  
  112. UFUNC funcs[] = {
  113.     "add", DYNAMIC,        /* add two numbers together */
  114.     "sub", DYNAMIC,        /* subtraction */
  115.     "tim", DYNAMIC,        /* multiplication */
  116.     "div", DYNAMIC,        /* division */
  117.     "mod", DYNAMIC,        /* mod */
  118.     "neg", MONAMIC,        /* negate */
  119.     "cat", DYNAMIC,        /* concatinate string */
  120.     "lef", DYNAMIC,        /* left string(string, len) */
  121.     "rig", DYNAMIC,        /* right string(string, pos) */
  122.     "mid", TRINAMIC,    /* mid string(string, pos, len) */
  123.     "not", MONAMIC,        /* logical not */
  124.     "equ", DYNAMIC,        /* logical equality check */
  125.     "les", DYNAMIC,        /* logical less than */
  126.     "gre", DYNAMIC,        /* logical greater than */
  127.     "seq", DYNAMIC,        /* string logical equality check */
  128.     "sle", DYNAMIC,        /* string logical less than */
  129.     "sgr", DYNAMIC,        /* string logical greater than */
  130.     "ind", MONAMIC,        /* evaluate indirect value */
  131.     "and", DYNAMIC,        /* logical and */
  132.     "or",  DYNAMIC,        /* logical or */
  133.     "len", MONAMIC,        /* string length */
  134.     "upp", MONAMIC,        /* uppercase string */
  135.     "low", MONAMIC,        /* lower case string */
  136.     "tru", MONAMIC,        /* Truth of the universe logical test */
  137.     "asc", MONAMIC,        /* char to integer conversion */
  138.     "chr", MONAMIC,        /* integer to char conversion */
  139.     "gtk", NILNAMIC,    /* get 1 charater */
  140.     "rnd", MONAMIC,        /* get a random number */
  141.     "abs", MONAMIC,        /* absolute value of a number */
  142.     "sin", DYNAMIC,        /* find the index of one string in another */
  143.     "env", MONAMIC,        /* retrieve a system environment var */
  144.     "bin", MONAMIC,        /* loopup what function name is bound to a key */
  145. };
  146.  
  147. #define    NFUNCS    sizeof(funcs) / sizeof(UFUNC)
  148.  
  149. /*     and its preprocesor definitions        */
  150.  
  151. #define    UFADD        0
  152. #define    UFSUB        1
  153. #define    UFTIMES        2
  154. #define    UFDIV        3
  155. #define    UFMOD        4
  156. #define    UFNEG        5
  157. #define    UFCAT        6
  158. #define    UFLEFT        7
  159. #define    UFRIGHT        8
  160. #define    UFMID        9
  161. #define    UFNOT        10
  162. #define    UFEQUAL        11
  163. #define    UFLESS        12
  164. #define    UFGREATER    13
  165. #define    UFSEQUAL    14
  166. #define    UFSLESS        15
  167. #define    UFSGREAT    16
  168. #define    UFIND        17
  169. #define    UFAND        18
  170. #define    UFOR        19
  171. #define    UFLENGTH    20
  172. #define    UFUPPER        21
  173. #define    UFLOWER        22
  174. #define    UFTRUTH        23
  175. #define    UFASCII        24
  176. #define    UFCHR        25
  177. #define    UFGTKEY        26
  178. #define    UFRND        27
  179. #define    UFABS        28
  180. #define    UFSINDEX    29
  181. #define    UFENV        30
  182. #define    UFBIND        31
  183.